package com.xianggu.designMode.stateMethod.impl;

import com.xianggu.designMode.stateMethod.PlayerState;
import com.xianggu.designMode.stateMethod.context.PlayerContext;

/**
 * 停止中状态：只能开始播放
 */
public class StoppedState implements PlayerState {
    @Override
    public void play(PlayerContext context) {
        System.out.println("[停止中] 开始播放视频");
        context.setState(new PlayingState()); // 切换到播放状态
    }

    @Override
    public void pause(PlayerContext context) {
        System.out.println("[停止中] 错误：未播放的视频无法暂停");
    }

    @Override
    public void stop(PlayerContext context) {
        System.out.println("[停止中] 已经是停止状态");
    }
}